﻿using KinonekoSoftware.ArkSpark.Runtimes.Presenters;

namespace KinonekoSoftware.ArkSpark.Core.Messages
{
    public sealed class ElementUpdatedEventArgs : IArkSparkEvent
    {
        public static readonly ElementUpdatedEventArgs Instance = new ElementUpdatedEventArgs();

        public ParagraphPresenter Paragraph { get; init; }
        
        public static void OnNext(IArkSparkMQ queue)
        {
            queue?.OnNext(Instance);
        }
        
        public static void OnNext(ParagraphPresenter paragraph, IArkSparkMQ queue)
        {
            queue?.OnNext(new ElementUpdatedEventArgs
            {
                Paragraph = paragraph,
            });
        }
    }
}